#!/usr/bin/env python
# coding=utf-8
# __author__ = 'Yunchao Ling'

from pymongo import MongoClient

DB_NAME = "pmc"
COLLECTION_NAME = "filelist"

connection = MongoClient('localhost', 27017)
db = connection[DB_NAME]
collection = db[COLLECTION_NAME]

parent_path = "ftp://ftp.ncbi.nlm.nih.gov/pub/pmc/"

results = collection.find({"nofile": {"$exists": 0}})
for result in results:
    path = result["path"]
    print parent_path + path
connection.close()
